import request from './request'

// 获取指定ID的运动记录
export const getExerciseRecordApi = id => request.get(`/exercise-records/${id}`)

// 获取当前用户的运动记录列表
export const getCurrentUserExerciseRecordsApi = () => request.get('/exercise-records/current')

// 创建运动记录
export const createExerciseRecordApi = data => request.post('/exercise-records', data)

// 更新运动记录
export const updateExerciseRecordApi = (id, data) => request.put(`/exercise-records/${id}`, data)

// 删除运动记录
export const deleteExerciseRecordApi = id => request.delete(`/exercise-records/${id}`)

// 根据日期范围获取运动记录
export const getExerciseRecordsByDateRangeApi = (startDate, endDate) => request.get('/exercise-records/date-range', {
    params: { startDate, endDate }
})

// 根据运动类型和日期获取记录
export const getExerciseRecordsByTypeApi = (exerciseType, date) => request.get('/exercise-records/exercise-type', {
    params: { exerciseType, date }
})

// 获取每日运动总结
export const getDailyExerciseSummaryApi = date => request.get('/exercise-records/daily-summary', {
    params: { date }
})

// 获取每周运动趋势
export const getWeeklyExerciseTrendApi = (startDate, endDate) => request.get('/exercise-records/weekly-trend', {
    params: { startDate, endDate }
})

// 获取运动统计数据
export const getExerciseStatisticsApi = (startDate, endDate) => request.get('/exercise-records/statistics', {
    params: { startDate, endDate }
}) 